//
// Created by xili on 2024/8/8 18:31.
// Go big or go home.
//
#include <vector>

using namespace std;

class Solution {
public:
    vector<long long> findPrefixScore(vector<int> &nums) {
        int n = nums.size();
        vector<long long> ans(n);
        int mx = 0;
        long long sum = 0;
        for (int i = 0; i < n; i++) {
            mx = max(mx, nums[i]);
            sum += mx + nums[i];
            ans[i] = sum;
        }
        return ans;
    }
};